sequenceDiagram
  Executor          ->>+ Frontend (proxy): Dequeue()
  Frontend (proxy)  ->>+ Executor queue: Dequeue()
  Executor queue    ->>+ DB store: BeginTx()
  Executor queue   -->>- Frontend (proxy): job
  Frontend (proxy) -->>- Executor: job

  loop
    Executor          ->>+ Frontend (proxy): Heartbeat(self.id, [job.id])
    Frontend (proxy)  ->>+ Executor queue: Heartbeat(self.id, [job.id])
    Executor queue   -->>- Frontend (proxy): Ok
    Frontend (proxy) -->>- Executor: Ok
  end

  Executor          ->>+ Frontend (proxy): GitClone(job.repo, job.commit)
  Frontend (proxy)  ->>+ Gitserver: GitClone(job.repo, job.commit)
  Gitserver        -->>- Frontend (proxy): ...
  Frontend (proxy) -->>- Executor: ...

  Executor        ->>+ Firecracker: setupFirecracker()
  Firecracker    -->>- Executor: vm

  loop dockerStep in job.dockerSteps
    Executor      ->>+ Firecracker: exec(vm.id, dockerStep.image, dockerStep.command)
    Firecracker  -->>- Executor: exit code, output
  end

  loop dockerStep in job.srcCliSteps
    Executor      ->>+ Firecracker: exec(vm.id, srcCliStep.command)
    Firecracker  -->>- Executor: exit code, output
  end

  Executor        ->>+ Firecracker: teardownFirecracker(vm.id)
  Firecracker    -->>- Executor: Ok

  loop
    Executor          ->>+ Frontend (proxy): AddExecutionLogEntry(job.id, combined exec output)
    Frontend (proxy)  ->>+ Executor queue: AddExecutionLogEntry(job.id, combined exec output)
    Executor queue   -->>- Frontend (proxy): Ok
    Frontend (proxy) -->>- Executor: Ok
  end

  Executor          ->>+ Frontend (proxy): MarkComplete(job.id)
  Frontend (proxy)  ->>+ Executor queue: MarkComplete(job.id)
  Executor queue    ->>  DB store: Commit()
  DB store         -->>- Executor queue: Ok
  Executor queue   -->>- Frontend (proxy): Ok
  Frontend (proxy) -->>- Executor: Ok
